package com.wt.chat.mapper;

import com.wt.chat.entity.Dialog;
import com.wt.chat.model.DialogModel;
import com.wt.chat.query.PageQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DialogMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Dialog record);

    int insertSelective(Dialog record);

    Dialog selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Dialog record);

	/**
	 * 按条件查询所有
	 * @param condition
	 * @return
	 */
	List<DialogModel> findByCondition(@Param("condition") Dialog condition);

	/**
	 * 查询历史会话
	 * @param condition
	 * @param pageQuery
	 * @return
	 */
	List<DialogModel> findHistory(@Param("condition") Dialog condition, @Param("pageQuery") PageQuery pageQuery);
}